package org.zsk.cs.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.zsk.cs.domain.po.SuggestionBox;
import org.zsk.cs.domain.vo.SuggestionBoxVo;

/**
 * <p>
 * 意见箱 service
 * </p>
 *
 * @author zsk
 * @version 1.0
 * Created on 2020/03/26
 */
public interface SuggestionBoxService extends IService<SuggestionBox> {

    /**
     * 居民投递意见箱
     * @param suggestionBox 意见箱
     */
    boolean addByResident(SuggestionBox suggestionBox);

    boolean addByAdmin(SuggestionBox suggestionBox);

    /**
     * 区长分页查箱
     * @param districtHeadId 区长身份id
     * @param page 分页
     * @return 区长的居民意见箱
     */
    Page<SuggestionBox> checkByDistrictHead(Long districtHeadId, Page<SuggestionBox> page);

    /**
     * 区长采箱
     * @param suggestionBox 意见箱
     */
    boolean adoptByDistrictHead(SuggestionBox suggestionBox);

    /**
     * @return 返回包含用户名的意见箱list
     * @throws Exception
     */
    public Page<SuggestionBoxVo> getWithUserNameByPage(SuggestionBoxVo suggestionBoxVo) throws Exception ;

    /**
     * @param suggestionBoxVo
     * @return 返回包含当前用户（居民）的意见箱list
     */
    public Page<SuggestionBoxVo> getWithUserNameByPageForResident(SuggestionBoxVo suggestionBoxVo) throws Exception;

    /**
     * 居民删除意见箱
     * @param suggestionBoxId
     * @return
     */
    boolean deleteByIdByResident(long suggestionBoxId);

    Page<SuggestionBoxVo> getWithUserNameByPageForDistrictHead(SuggestionBoxVo suggestionBoxVo) throws Exception;
}
